home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / turbovis / oodb.zip / INTFACE.DOC < prev    next >
Text File  |  1992-07-14  |  3KB  |  89 lines

  1. Here is the interface of OODB (brief description).
  2.  
  3. { --- TBASE - the main class --- }
  4.  
  5. type TBase =
  6.         object (TObject)
  7.  
  8.            constructor Init (AStream: PStream);
  9.            destructor  Done;
  10.            procedure   Abort;
  11.            procedure   Commit;
  12.            function    Create: Word;
  13.            procedure   Put (PID: Word; P: PObject);
  14.            function    Get (PID: Word): PObject;
  15.            procedure   Destroy (PID: Word);
  16.  
  17.            function    ObjSize (PID: Word): Longint;
  18.            function    Count: Integer;
  19.  
  20.            procedure   IdlePack;
  21.  
  22.         end; { -- TBase -- }
  23. PBase = ^TBase;
  24.  
  25. Init (AStream: PStream)
  26. ------------------------
  27. Opens the database. The only argument is a stream to use as a storage
  28. for the database. The stream should be created before Init is called.
  29. OODB checks the header of stream. If OODB doesn't recognize it then
  30. the stream is cleared and the database is considered empty.
  31. If the header is recognized then the stream is opened as an existing
  32. database.
  33. WARNING: If wrong stream is supplied to OODB then all information
  34. in it will be erased!
  35.  
  36. Done
  37. -----
  38. Closes database.
  39.  
  40. Abort
  41. ------
  42. Rollbacks transaction and returns database to its state before
  43. the last Commit (see README.DOC).
  44.  
  45. Commit
  46. -------
  47. Completes transaction. All previous changes of the database
  48. become irrevokable.
  49.  
  50. Create: Word
  51. -------------
  52. Generates new PID (Permanent IDentifier). You're guaranteed that
  53. if you use this PID while storing an object to the database you'll always
  54. be able to retrieve it using the same PID (unless current transaction
  55. has been rollbacked).
  56.  
  57. Put (PID: Word; P: PObject)
  58. ----------------------------
  59. Puts an object referenced by P to the database and assigns PID to it.
  60. It is strongly advised to precede this command by Create (PID).
  61. This PID should always be used while referring to the object until
  62. the latter is removed from the database.
  63.  
  64. Get (PID: Word): PObject
  65. -------------------------
  66. Creates a copy of the database object identified by PID and
  67. returns a pointer to it.
  68.  
  69. Destroy (PID: Word)
  70. --------------------
  71. Removes the object identified by PID from the database. If current
  72. transation is finished by Abort then the object will become accessible
  73. again. If the transaction is to be completed by Commit then the object
  74. will be irrevokably deleted from the database.
  75.  
  76. ObjSize (PID: Word): Longint
  77. -----------------------------
  78. Returns the number of bytes held in the database stream by
  79. the object identified by PID.
  80.  
  81. Count: Integer
  82. ---------------
  83. Returns the current number of objects in the database.
  84.  
  85. IdlePack
  86. ---------
  87. Performs one step of garbage collection.
  88.  
  89. There are also comments in the source code of OODB.